import request from "@/api/config";
import { AxiosPromise } from 'axios';
import { InitializePrefixGoodsServiceVO, InitializePrefixGoodsServiceForm, InitializePrefixGoodsServiceQuery } from '@/leadMall/api/initializePrefixGoodsService/types';
import {PORT} from "@/api/config/servicePort";

/**
 * 查询【请填写功能名称】列表
 * @param query
 * @returns {*}
 */

export const listInitializePrefixGoodsService = (query?: InitializePrefixGoodsServiceQuery): AxiosPromise<InitializePrefixGoodsServiceVO[]> => {
  return request({
    url: PORT +'/system/initializePrefixGoodsService/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param id
 */
export const getInitializePrefixGoodsService = (id: string | number): AxiosPromise<InitializePrefixGoodsServiceVO> => {
  return request({
    url: PORT +'/system/initializePrefixGoodsService/' + id,
    method: 'get'
  });
};

/**
 * 新增【请填写功能名称】
 * @param data
 */
export const addInitializePrefixGoodsService = (data: InitializePrefixGoodsServiceForm) => {
  return request({
    url: PORT +'/system/initializePrefixGoodsService',
    method: 'post',
    data: data
  });
};

/**
 * 修改【请填写功能名称】
 * @param data
 */
export const updateInitializePrefixGoodsService = (data: InitializePrefixGoodsServiceForm) => {
  return request({
    url: PORT +'/system/initializePrefixGoodsService',
    method: 'put',
    data: data
  });
};

/**
 * 删除【请填写功能名称】
 * @param id
 */
export const delInitializePrefixGoodsService = (id: string | number | Array<string | number>) => {
  return request({
    url: PORT +'/system/initializePrefixGoodsService/' + id,
    method: 'delete'
  });
};
